package main

import "fmt"

// Author : CSR丶WARRIOR
// Time ： 2020/10/17  14:11
// TOOLS : GoLand
// FILENAME : Type assertion.go
// STATEMENT: 类型断言

func main() {
	assertion()
}

func assertion() {
	var list1 = make([]interface{}, 0)
	list1 = append(list1, 1, "hello", 23.567, 'p', -34.2)
	for i := 0; i < len(list1); i++ {
		value, ok := list1[i].(float64)
		if ok {
			fmt.Print(value, " ") //23.567 -34.2
		}
	}
}
